package com.es.api.enums;

/**
 * 描述:
 * Old-AgeCareSystem- 业务操作类型枚举
 *
 * @author Derek
 * @create 2021-12-06 11:18
 */
public enum BusinessTypeEnum {

    LOGIN(1,"LOGIN"),BUSINESS(2, "OPERATE");
    int code;
    String title;
    BusinessTypeEnum(int code, String title){
        this.code = code;
        this.title = title;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getTitleByCode(int code){
        BusinessTypeEnum[] typeEnums = BusinessTypeEnum.values();
        for (int i = 0; i < typeEnums.length; i++) {
            if(code == typeEnums[i].getCode()){
                return typeEnums[i].getTitle();
            }
        }
        return "null";
    }
}
